<?php
class ModuleIndexAction extends AdminAction
{
	public function __construct()
	{
		parent::__construct();
		$this->layout = 'default';
	}
	
	public function execute()
	{
		$moduleService = new BaseDbService('module');
		
		$position = $this->context->get('position');
		if(!is_numeric($position))
		{
			$position = 0;
		}
		$this->data['position'] = $position;
		
		$this->data['modules']  = $moduleService->rows(array('position'=>$position), 'orderby DESC,id ASC');
		
		if($position==0)
		{
			$this->data['menu'] = 'index_module';
		}
		else
		{
			//TODO 增加频道后扩展
			$this->data['menu'] = 'index_module';
		}
	}
}
